@extends('layouts.app')
@section('content')
<!-- start: Content -->
<div class="row-fluid">		
	<div class="box span12">
		<div class="box-header" data-original-title="">
			<h2><span class="break"></span>用户管理</h2>
		</div>
		<div class="box-content">
		<form action="{{ URL('user/list') }}" method="POST">
			{{ csrf_field() }}
			<table class="table table-striped">
				<thead>
					<tr>
				  		<th style='width:35%;'>
				  			<select  style='width:95px;' name='vip'>
									<option value='0'>普通用户</option>
									<option value='1'>VIP黄金用户</option>
							</select>
							<select  style='width:95px;' name='ustatus'>
									<option value='1'>正常</option>
									<option value='0'>封禁</option>
							</select>
							<select  style='width:95px;' name='type'>
									<option value='name'>用户昵称</option>
									<option value='mobile'>绑定手机号</option>
							</select>
							
							<div style='width:200px;margin-bottom:-12px;float: right;'>
				  				<input type="search" style='height:20px;border:1px solid black;background:grey;width:130px;color:grey;'  placeholder='关键字搜索' name='index' />
				  				<button style='float: right;' type="submit" class="btn btn-primary">搜索</button>
				  			</div>
				  			
				  		</th>
				  		<th style='width:150px;'>
				  			
				  		</th>
				  		<th>
				  			
				  		</th>
				  	</tr>
				  </thead>
				</table>
			</form>
			<table class="table table-striped">
			<thead>
			  	<tr>
				  	<!-- <th style='width:15px;'> -->
				  		<!-- <span class=""><input type="checkbox" name='id[]' id="inlineCheckbox3" value="option3"></span> -->
				  	<!-- </th> -->
					<th  style='width:35px;'>序号</th>
					<th>用户头像</th>
					<th>用户昵称</th>
					<th>会员状态</th>
					<th>绑定手机号</th>
					<th>用户状态</th>
					<th>操作</th>
			  	</tr>
			</thead>   
			<tbody>
				@foreach($user as $uv)
				<form action="{{ URL('user',$uv->id) }}" method='POST'>
					{{ csrf_field() }}
					{{ method_field('PUT') }}
					<tr>
						<!-- <td><input type="checkbox" name='uid[]' id="inlineCheckbox3" value="{{ $uv->id }}"></td> -->
						<td style='text-align: center;'>{{ $uv->id }}</td>
						<td>
							<img src="{{ $uv->avatar }}" alt="" style='width:65px;height:25px;'>
						</td>
						<td>{{ $uv->name }}</td>
						<td id='{{ $uv->id }}1' class="center" style='display: ;'>
							@if($uv->vip == 0)
								<span>普通用户</span>
							@elseif($uv->vip == 1)
								<span class="center text-warning">VIP黄金用户</span>
							@endif
						</td>
						<td id='{{ $uv->id }}22' style='display: none;' class="center text-warning">
							<select name='vstatus' class="form-control">
							  <option value='0'>普通用户</option>
							  <option value='1'>VIP黄金用户</option>
							</select>
						</td>
						<td class="center">{{ $uv->phone }}</td>
						<td id='{{ $uv->id }}2' class="center" style='display: ;'>
							@if($uv->status == 1)
								<span class='label label-success'>正常</span>
							@elseif($uv->status == 0)
								<span class="label label-primary">禁用</span>
							@endif
						</td>
						<td id='{{ $uv->id }}33' style='display:none;' class="center text-warning">
							<select name='ustatus' class="form-control">
							  <option value='1'>正常</option>
							  <option value='0'>禁用</option>
							</select>
						</td>
						<td class="center">
							<button id='{{ $uv->id }}4' type='button' class="btn btn-primary" style='display: ;' value='{{ $uv->id }}'  onclick="btn(this.value)">
								设置
							</button>
							<button id='{{ $uv->id }}44' class="btn btn-danger" style='display:none;'>
								确定
							</button>
						</td>
					</tr>
				</form>
				@endforeach
			  </tbody>
		  </table>           
		</div>
	</div><!--/span-->

</div><!--/row-->
<!-- end: Content -->
@stop
<script>
	function btn(e){

		document.getElementById(e+22).removeAttribute("style");
		document.getElementById(e+33).removeAttribute("style");
		document.getElementById(e+44).removeAttribute("style");
		document.getElementById(e+4).style.display="none";
		document.getElementById(e+1).style.display="none";
		document.getElementById(e+2).style.display="none";
		document.getElementById(e+3).style.display="none";
		

	}


</script>